<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<title>定期存款计算器</title>
<link href="base.css" rel="stylesheet" type="text/css">
<link href="tool.css" rel="stylesheet" type="text/css">
<link href="art.default.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="base.js"></script>
<script type="text/javascript" src="artDialog.basic.js"></script>
<script type="text/javascript">

function decul() {
	

	var deSaveTime = $id('deSaveTime');
	var deYearRate = $id('deYearRate');
	var deInitSaveSum = $id('deInitSaveSum');

    if (!checkFormPlus( deYearRate, "年利率")){return false;}
    if (!checkFormPlus(deInitSaveSum, "初期存入金额")){return false};

    
	
	deInitSaveSum = parseInt(deInitSaveSum.value);

    YearRate = parseFloat( deYearRate.value );

    //var diffday =  parseInt(parseFloat(hqDate.value) * 30);
	var diffday = parseFloat(deSaveTime.value);
	var taxrate=0.00;//Saving Tax Rate,20090210
    var result=deInitSaveSum*(1+(1-taxrate)*YearRate*diffday*0.01/12) 

	result=(result * 100).format(2);
	result=result/100 

	
	
    $id('deTermEndSum').value = result.format(2);



}

//定期存款利率
function degetrate(){
    val = $id("deSaveTime").value; //存款时间
	var rate = {'3':'3.10', '6':'3.30', '12':'3.50', '24':'4.40', '36':'5.00', '60':'5.50'};
	$id("deYearRate").value = rate[val];
}


//form reset
function frmReset(frmobj){
	frmobj.reset();
	degetrate();
}

window.onload = function(){
	frmReset($id("formact"));
}

</script>
</head>
<body>
<div class="container" id="container">
  <form action="" method="post" id="formact" onSubmit="return false;">
  <div class="title">
    <h2>定期存款计算器</h2>
    <div class="bg"></div>
  </div>
  <div class="content">
      
      <div class="warm_tip">
      	<p>定期存款计算器可以对整存整取到期本息总额进行计算；到期本息总额为扣除利息税后的净值。
        </p>
      </div> 	
        
      <ul class="form_items">
        <li>
          <label>存款方式:</label>
          <span>
          <!--<input value="" type="radio" class="radio" id="depositWay_0" name="depositWay" onClick="changeall();" checked="checked">--> 整存整取
          </span> </li>
        <li>
          <label>计算选项:</label>
          <span>
          <!--<input value="" type="radio" class="radio" id="deCalcOption_0" name="deCalcOption" onClick="changeOption();" checked="checked">--> 计算到期本息总额
          </span> </li>
        <li>
          <label>储蓄存期:</label>
          <span>
          <select id="deSaveTime" name="deSaveTime" onChange="degetrate()">
            <option value="3">三个月</option>
            <option value="6">半年</option>
            <option value="12" selected="selected">一年</option>
            <option value="24">二年</option>
            <option value="36">三年</option>
            <option value="60">五年</option>
           </select>
          </span> </li>
        <li>
          <label>年利率:</label>
          <span>
          <input value="" type="text" id="deYearRate" name="deYearRate"/> %
          </span> </li>
        <li>
          <label>初期存入金额:</label>
          <span>
          <input value="" type="text" id="deInitSaveSum" name="deInitSaveSum"> 元
          </span> </li>
      </ul>
      <div class="button_bar">
        <input type="button" onClick="decul();" value="开始计算" class="submit"/>
        <input type="button" id="hqResetBtn" value="重新计算" class="reset" onClick="frmReset(this.form)"/>
      </div>
    
  </div>
  <div class="title">
    <h2>计算结果</h2>
    <div class="bg"></div>
  </div>
  <div class="content">
    <ul class="form_items">
      <li>
        <label>到期本息总额：</label>
        <span>
        <input type="text" value="" id="deTermEndSum" name="deTermEndSum" readonly="readonly" disabled="true" role="disabled"/>
        </span> </li>
    </ul>
  </div>
  </form>
</div>
</body>
</html>
